import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const store = new Vuex.Store({
  state: {
	  'activeTab':"",//底部导航栏
	 'isSwitchRankings':false,
	  'isUsersListChange':"",
	  "isMessagesListChange":"",
	  "networkStatus":false,
	  "isCommentsChange":"",
	  "isLikesChange":"",
	  "isFansChange":"",
	  "isConnect":","
  },
  mutations: { 
	  setActiveTab(state,url){
		  state.activeTab=url;
	  },
	  setNetworkStatus(state,networkStatus){
		  state.networkStatus=networkStatus;
	  },
	   toggleRankings(state) {
	        state.isSwitchRankings = !state.isSwitchRankings; // 切换状态
	    },
		changeUsersList(state,uid){
				  state.isUsersListChange=uid
		},
		changeMessagesList(state,uid){
				  state.isMessagesListChange=uid
		},
		changeComments(state,uid){
			state.isCommentsChange=uid
		},
		changeLikes(state,uid){
			state.isLikesChange=uid
		},
		changeFans(state,uid){
			state.isFansChange=uid
		},
		changeConnect(state,uid){
			state.isConnect=uid
		}
  },
  actions: { 
	  toggleRankings({ commit }) {
	        commit('toggleRankings');
	    },
  },
  getters: { 
	activeTab:state=>state.activeTab,
  }
})
export default store
